package com.base.monitor.admin.controller.biz.cfg;

import com.base.monitor.framework.annotation.ResponseResult;
import com.base.monitor.framework.exception.CustomerException;
import com.base.monitor.framework.properties.SystemProperties;
import com.base.monitor.framework.util.DiskUtils;
import com.base.monitor.framework.util.IpUtils;
import com.base.monitor.model.constant.CommonConstant;
import com.base.monitor.model.enums.code.impl.server.ServerCode;
import com.base.monitor.module.biz.properties.NetworkProperties;
import com.base.monitor.module.biz.service.cfg.ServerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.refresh.ContextRefresher;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

@RestController
@RequestMapping("/cfg/server")
@ResponseResult
@Slf4j
public class ServerController {

    @Autowired
    private ServerService serverService;

    /**
     * 修改端口号
     *
     * @param port 端口号
     */
    @GetMapping("/change/{port}")
    public void changeServerPort(@PathVariable("port") Integer port) {
        serverService.changeServerPort(port);
    }
}
